<template>
  <div>
    <h1>登录</h1>
    <input type="text" v-model="username" placeholder="账号">
    <input type="password" v-model="password" placeholder="密码">
    <button @click="login">登录</button>
  </div>
</template>

<script>
export default {
  data() {
    return {
      username: '',
      password: ''
    }
  },
  methods: {
    login() {
      if (this.username === '王宇' && this.password === '22219111442') {
        this.$router.push('/studentSystem');
        alert("登陆成功");
      } else {
        alert('账号或密码错误');
      }
    }
  }
}
</script>